package com.kede.app.domain;

import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;

/**
* @description /
* @author Pr.li
* @date 2023-05-27
**/
@Entity
@Data
@Table(name="sy_leescore_good_type_ids")
public class LeescoreGoodTypeIds implements Serializable {
    /**
    * 
    */
    @ApiModelProperty(value = "id")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    private Integer id;
    /**
    * 1 主选项 2子选项
    */
    @Column(name = "`pid`",nullable = false)
    @NotNull
    private Integer pid;
    /**
    * 商品id
    */
    @ApiModelProperty(value = "商品id")
    @Column(name = "`good_id`",nullable = false)
    @NotNull
    private Integer goodId;
    /**
    * 选品id
    */
    @ApiModelProperty(value = "选品id")
    @Column(name = "`goo_type_id`",nullable = false)
    @NotNull
    private Integer gooTypeId;

    public void copy(LeescoreGoodTypeIds source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
